<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
/**
 * -----------------------
 * 路由分组
 * -----------------------
 */
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['REQUEST_URI'] =  (isset($paramsArgv[2]) && !empty($paramsArgv[2]))
    ? $paramsArgv[1] . '?' . $paramsArgv[2] : $paramsArgv[1];
if ((isset($paramsArgv[2]) && !empty($paramsArgv[2])))
{
    $_SERVER['REQUEST_URI'] = $paramsArgv[1] . '?' . $paramsArgv[2];
    $_SERVER['QUERY_STRING'] = $paramsArgv[2];
} else {
    $_SERVER['QUERY_STRING'] = '';
    $_SERVER['REQUEST_URI'] = $paramsArgv[1];
}
$_SERVER['ARGV'] = json_encode($paramsArgv);
if ($paramsArgv[1] == '/demo') {

    $app->addRoute('GET', '/demo', 'App\Jobs\Demo\Demo@handle');
}

if ($paramsArgv[1] == '/mail') {

    $app->addRoute('GET', '/mail', 'App\Http\Controllers\IndexController@mail');
}

if ($paramsArgv[1] == '/msg') {

    $app->addRoute('GET', '/msg', 'App\Http\Controllers\IndexController@sendMsg');
}
